{# Macros used only by the auth pages. The generic kit lives in components/macros.html; these ship with the auth service, so they are separate rather than mixed into it. Import them the same way: {% from "components/auth_macros.html" import auth_field %} #} {% from "components/macros.html" import password_input %} {# Labeled text/email/password input with the auth-form styling. Used by every auth page so the forms stay consistent and each input carries the right ``autocomplete`` hint (which is what lets a password manager offer to save and autofill). A caller body renders right-aligned in the label row, used for the "Forgot?" link on the password field: {% call auth_field("password", "Password", type="password") %} Forgot? {% endcall %} #} {% macro auth_field(name, label, type="text", autocomplete=None, required=True, minlength=None, placeholder="") %}
{% if caller is defined %}{{ caller() }}{% endif %}
{% if type == "password" %} {# Password fields delegate to ``password_input`` so the show/hide eye toggle is consistent everywhere. Other types stay a plain and don't pay for the Alpine wrapper. #} {{ password_input(name=name, autocomplete=autocomplete, required=required, minlength=minlength, placeholder=placeholder) }} {% else %} {% endif %}
{% endmacro %} {# Banner for a form-level message. ``tone`` is "ok" or "error". #} {% macro auth_banner(expr, tone="error") %} {% endmacro %}